import request from '@/utils/request'

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/admin/user/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getUser(id) {
  return request({
    url: '/admin/user/' + id,
    method: 'get'
  })
}
// 获取企业用户
export function selectUsersByTop() {
  return request({
    url: '/admin/user/selectUsersByTop',
    method: 'get'
  })
}

// 新增用户
export function addUser(data) {
  return request({
    url: '/admin/user',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/admin/user',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delUser(id) {
  return request({
    url: '/admin/user/' + id,
    method: 'delete'
  })
}

// 获取未审核用户
export function getNoAuditUser() {
  return request({
    url: '/admin/user/getNoAuditUser',
    method: 'get'
  })
}

export function resetPassword(id){
  return request({
    url:'/admin/user/reset',
    method:'post',
    data:{
      id,
      password:"123456"
    }
  })
}